package com.cnpinxi.controller.web.pay;

import com.cnpinxi.controller.base.BaseController;
import com.cnpinxi.domain.ConsigneeInfo;
import com.cnpinxi.domain.PayParameter;
import com.cnpinxi.domain.Payment;
import com.cnpinxi.myRunTime.MyRunTimeExcption;
import com.cnpinxi.result.ResultObj;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Baggio on 2018-3-6.
 */
@RequestMapping("/payment")
@Controller
public class PayMentController extends BaseController {

    @RequestMapping(value = "/getPaymentList")
    @ResponseBody
    public String getPaymentList(HttpServletRequest request, Long orderId, Integer orderPrice, Payment payment, ConsigneeInfo consigneeInfo) {
        ResultObj resultObj = new ResultObj();
        resultObj.setCode(ResultObj.CODE_SUCCESS);
        PayParameter payParameter = null;
        try {

           ;
            resultObj.setData(payParameter);
            logger.info("payParameter===>" + payParameter.toString());
        } catch (MyRunTimeExcption runTimeExcption) {
            logger.info(runTimeExcption.getMessage());
            resultObj.setCode(ResultObj.CODE_FAIL);
            resultObj.setMsg(runTimeExcption.getMessage());
            runTimeExcption.printStackTrace();
        } catch (Exception e) {
            logger.info(e.getMessage());
            e.printStackTrace();
            resultObj.setCode(ResultObj.CODE_FAIL);
            resultObj.setMsg(e.getMessage());

        }
        return resultObj.toJson();
    }

}
